package com.bishe.dao;

import com.bishe.pojo.Business;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 业务数据层
 * @date 2022/03/02 36:11:09
 */
public interface BusinessDao {

    @Select("select * from business")
    List<Business> findAll();


    @Select("select * from business where id = #{id}")
    Business findById(@Param("id") String id);

    @Delete("delete  from business where id = #{id}")
    void deleteById(@Param("id") String id);


    @Update("update business set id = #{id},createTime = #{createTime},type = #{type},email = #{email},phone = #{phone},count = #{count},name = #{name},sex = #{sex},createBy = #{createBy} where id = #{id}")
    void updateById(Business business);


    @Insert("insert into business(id,createTime,type,email,phone,count,name,sex,createBy) values(#{id},#{createTime},#{type},#{email},#{phone},#{count},#{name},#{sex},#{createBy})")
    void save(Business business);
}

